1. Field of the Invention
The present invention relates to a data processing apparatus and to a control method for a data processing apparatus.
2. Description of the Related Art
Data processing apparatuses such as printers and scanners are now used in a wide range of personal and business applications. A printer is used by way of example below as a data processing apparatus.
Firmware disposed inside the printer is run to control printer operation. This firmware broadly includes two types of programs: a boot program that executes a sequence of operations required to start printer operation, including hardware initialization, and a main program that is run after the startup operation of the boot program to control the printer using instructions from a host computer. The boot program and main program are stored in different sectors in flash ROM disposed in the printer, and flash ROM content can be rewritten by sector unit. More specifically, the boot program and main program can be separately updated by overwriting the sectors storing the boot program and main program in flash ROM.
If writing the sectors where the boot program is stored (the “boot sectors”) fails, however, the printer cannot execute the startup process controlled by the boot program, and the printer is thus rendered unable to start operation. To avoid this problem, Japanese Unexamined Patent Appl. Pub. 2004-94628 teaches a double boot method whereby a plurality of selectively read boot sectors are provided so that if rewriting the boot program stored in one boot sector fails, the program can start up using the normal boot program stored in the other boot sector.
If writing to one of the two sectors used for this double boot function fails when simultaneously overwriting both the boot program and main program in a printer having this double boot function, the overwrite procedure could result in only the main program being overwritten while writing the boot program failed. The next time the power is turned on after this happens, the printer will boot using the older version of the boot program stored in the one boot sector where overwriting did not fail, and the new version of the main program stored in the main sector that was correctly overwritten then runs. Because the printer operates normally when this happens the user may wrongly think that the double boot sectors were correctly rewritten. The printer may sometimes boot normally and operate without any problem when this happens, but the problems addressed by upgrading the firmware are not actually corrected, and the printer may continue operating while containing a fatal firmware error.